import {JSEncrypt} from "jsencrypt";

let publicRsaKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCHZrSQkkcUMYSEAaCBlo2yaQWbwpD3qs3G/t/f\n" +
        "U153qLuJ1UrynyTtwoeLNGwv2C+rf8sZK5LZ1lrBfLJrtk6KRc5XVD7zRyS/zypQ+zh0FPEmj0XG\n" +
        "rF2UPkGFla939duCvaYSTmGXS4vOCdDRot8m8mUHiPFMIGvfiq2ZaJaVGQIDAQAB";
export default {
    //RSA加密文本
    encodeRSA(text){
        //创建对象
        const jsRsa = new JSEncrypt()
        //设置公钥
        jsRsa.setPublicKey(publicRsaKey)
        //返回加密结果
        return jsRsa.encrypt(text)
    }
}